/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package elaborate.tool.messenger.secret;

/**
 *
 * @author lendle
 */
public class EncrypterUtil implements Encrypter{
    private Encrypter defaultEncrypter=new BlowFishEncrypter();
    private static EncrypterUtil instance=null;
    protected EncrypterUtil(){
        
    }

    public synchronized static EncrypterUtil getInstance(){
        if(instance==null){
            instance=new EncrypterUtil();
        }
        return instance;
    }

    @Override
    public byte[] encrypt(byte[] key, String originalString) throws Exception {
        return this.defaultEncrypter.encrypt(key, originalString);
    }

    @Override
    public String decrypt(byte[] key, byte[] secret) throws Exception {
        return this.defaultEncrypter.decrypt(key, secret);
    }

    @Override
    public String encryptString(String key, String originalString) throws Exception {
        return this.defaultEncrypter.encryptString(key, originalString);
    }

    @Override
    public String decryptString(String key, String secret) throws Exception {
        return this.defaultEncrypter.decryptString(key, secret);
    }
    
    
}
